#include <shell.h>
#include <screen.h>

void cat (char * param)
{
	fs_node_t *fsnode = finddir_fs(GetCurrentNodeDir(), param);
	if (!fsnode)
	{
		kprintf ("Cannot open file: %s\n", param);
		return;
	}
	char buf[256];
	int seek = 0;
	uint32 sz = read_fs(fsnode, seek, 256, buf);
	while (sz > 0)
	{
		seek += sz;
		int i = 0;
		for (i = 0; i < sz; i++)
			putch (buf [i]);
		sz = read_fs(fsnode, seek, 256, buf);
	}
	kprintf("\n");
}
